//
//  GRConfirmOrderAction.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/7/16.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRConfirmOrderAction.h"

@implementation GRConfirmOrderAction
-(void)getConfirmOrderFirstInfo:(NSDictionary *)dic SuccessBlock:(void(^)(GRConfrimOrderModel * orderInfoModel))successBlock{
    [RequestManager getConfirmOrderFirstInfo:dic ComplectionHander:^(BOOL success, id responseObject, GRError *error) {
        if (success) {
            if( Dictionary(responseObject)){
         GRConfrimOrderModel * confirmOrderModel = [GRConfrimOrderModel yy_modelWithDictionary:responseObject];
                successBlock(confirmOrderModel);
            }
        }
    }];
}
-(void)getPayDetailInfomation:(NSDictionary*)dic SuccessBlock:(void(^)(GRConfrimOrderModel * orderInfoModel))successBlock{
    [RequestManager getPayDetailInfo:dic ComplectionHander:^(BOOL success, id responseObject, GRError *error) {
        if (success) {
            if( Dictionary(responseObject)){
                GRConfrimOrderModel * confirmOrderModel = [GRConfrimOrderModel yy_modelWithDictionary:responseObject];
                successBlock(confirmOrderModel);
            }
        }

    }];
}
-(void)payOrderWithOrderDic:(NSDictionary *)dic SuccessBlock:(void(^)(id responseObject))successBlock{
    [RequestManager grPayOrder:dic ComplectionHander:^(BOOL success, id responseObject, GRError *error) {
        if (success) {
            NSLog(@"支付接口回调%@",responseObject);
             successBlock(responseObject);
        }else{
            [GRHUD showMessage:error.errorMsg];
        }
    }];
    
}
-(void)getOrderPayDetailInfo:(NSInteger)orderId   SuccessBlock:(void(^)(GRConfrimOrderModel * orderInfoModel))successBlock{
    [RequestManager getOrderPayInfo:orderId ComplectionHander:^(BOOL success, id responseObject, GRError *error) {
        if (success) {
            if(Dictionary(responseObject)){
            GRConfrimOrderModel * confirmOrderModel = [GRConfrimOrderModel yy_modelWithDictionary:responseObject];
                successBlock(confirmOrderModel);
            }
        }
    }];
    
}


@end
